<html>
    <head>
     <script src="jquery-3.3.1.js"></script>
       <script>
           $(function(){
            
           $("#addNote").click(function(){
            var li ="<li>冰球</li>";
            var basketball = $(".basketball")
            $(li).insertAfter(basketball);
           })

            /*
            var li ="<li>冰球</li>";
            console.log(li);  
            $("#ball").append(li);
           })*/
           $("#removeBtm").click(function(){
               $("#ball").remove();
           })



            
           })
       </script>

    </head>
    <body>
        <div>
            <input type="button" value="添加" id="addNote"><br>
            <input type="button" value="删除" id="removeBtm"> 
            
        </div>
       <div>
        <ul id="ball">
        <li>足球</li>
        <li>网球</li>
        <li class="basketball">篮球</li>
    </ul>
       </div>
       
        
    </body>
</html>